const mongoose = require('./db');
const article = require('./models/article');
const commend = require('./models/commend');

var a = new article({
    title:'加里奥的自我修养',
    content:'先w后e再q后r,打的敌人跪地找娘',
    time:new Date().toLocaleString(),
    classify:'LOL',
    count:0
})

a.save().then(() => {
    console.log('数据插入成功');
    // 断开链接
    mongoose.disconnect();
}).catch((err) => {
    console.log('数据插入失败');
    console.log(err);
    mongoose.disconnect();
})

// var c = new commend({
//     commend:'爆爆已经死了,耶稣也留不住,我说的',
//     fromId:'624c1715d7efb7383706ec9d',
//     date:new Date().toLocaleString(),
// })

// c.save().then(() => {
//     console.log('评论成功');
//     mongoose.disconnect();
// }).catch((err) => {
//     console.log('平路失败');
//     mongoose.disconnect();
// })